<?php
class Comment_model extends CI_Model{
	function __construct(){
		parent::__construct();
	}
    

    function getCommentByBookId($book_id) {
        $this->db->where("book_id",$book_id);
        //$this->db->limit(0,100);
        return $this->db->get("comment")->result();
    }

    function insertComment($data) {
        if(empty($data['book_id'])){
            exit;
        }
        $this->db->insert('comment',$data);
        return $this->db->insert_id();
    }
}
?>